#!/usr/bin/env bash

status=$(nmcli g | grep -o "disconnected")
essid=$(nmcli c | grep "wlp5s0" | awk '{for (i=0;i<=2;i++) $(NF-i)="";print}')

if [ "$status" == "disconnected" ]; then
	icon=""
	text=""
	col="#575268"

else
	icon=""
	text="${essid}"
	col="#e48aff"
fi

if [[ "$1" == "--COL" ]]; then
	echo $col
elif [[ "$1" == "--ESSID" ]]; then
	echo "$text"
elif [[ "$1" == "--ICON" ]]; then
	echo $icon
fi
